.class abstract Lcom/hierynomus/spnego/d;
.super Ljava/lang/Object;
.source "SpnegoToken.java"


# instance fields
.field private a:I

.field private b:Ljava/lang/String;


# direct methods
.method public constructor <init>(ILjava/lang/String;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    iput p1, p0, Lcom/hierynomus/spnego/d;->a:I

    .line 3
    iput-object p2, p0, Lcom/hierynomus/spnego/d;->b:Ljava/lang/String;

    return-void
.end method


# virtual methods
.method protected a(Lcom/hierynomus/asn1/e;)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 7
    instance-of v0, p1, Lcom/hierynomus/asn1/w;

    if-eqz v0, :cond_3

    move-object v0, p1

    check-cast v0, Lcom/hierynomus/asn1/w;

    invoke-virtual {v0}, Lcom/hierynomus/asn1/w;->k()I

    move-result v1

    iget v2, p0, Lcom/hierynomus/spnego/d;->a:I

    if-ne v1, v2, :cond_3

    .line 8
    invoke-virtual {v0}, Lcom/hierynomus/asn1/w;->j()Lcom/hierynomus/asn1/q;

    move-result-object p1

    .line 9
    instance-of v0, p1, Lcom/hierynomus/asn1/r;

    if-eqz v0, :cond_2

    .line 10
    check-cast p1, Lcom/hierynomus/asn1/r;

    invoke-virtual {p1}, Lcom/hierynomus/asn1/r;->j()Ljava/util/Enumeration;

    move-result-object p1

    .line 11
    :goto_0
    invoke-interface {p1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 12
    invoke-interface {p1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hierynomus/asn1/e;

    .line 13
    instance-of v1, v0, Lcom/hierynomus/asn1/w;

    if-eqz v1, :cond_0

    .line 14
    check-cast v0, Lcom/hierynomus/asn1/w;

    .line 15
    invoke-virtual {p0, v0}, Lcom/hierynomus/spnego/d;->a(Lcom/hierynomus/asn1/w;)V

    goto :goto_0

    .line 16
    :cond_0
    new-instance p1, Lcom/hierynomus/spnego/SpnegoException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Expected an ASN.1 TaggedObject as "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/hierynomus/spnego/d;->b:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, " contents, not: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {p1, v0}, Lcom/hierynomus/spnego/SpnegoException;-><init>(Ljava/lang/String;)V

    throw p1

    :cond_1
    return-void

    .line 17
    :cond_2
    new-instance v0, Lcom/hierynomus/spnego/SpnegoException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Expected a "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/hierynomus/spnego/d;->b:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, " (SEQUENCE), not: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-direct {v0, p1}, Lcom/hierynomus/spnego/SpnegoException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 18
    :cond_3
    new-instance v0, Lcom/hierynomus/spnego/SpnegoException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Expected to find the "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/hierynomus/spnego/d;->b:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, " (CHOICE ["

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v2, p0, Lcom/hierynomus/spnego/d;->a:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v2, "]) header, not: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-direct {v0, p1}, Lcom/hierynomus/spnego/SpnegoException;-><init>(Ljava/lang/String;)V

    goto :goto_2

    :goto_1
    throw v0

    :goto_2
    goto :goto_1
.end method

.method protected abstract a(Lcom/hierynomus/asn1/w;)V
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/spnego/SpnegoException;
        }
    .end annotation
.end method

.method protected a(Lcom/hierynomus/protocol/commons/buffer/Buffer;Lcom/hierynomus/asn1/f;)V
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "*>;",
            "Lcom/hierynomus/asn1/f;",
            ")V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    new-instance v0, Lcom/hierynomus/asn1/f1;

    iget v1, p0, Lcom/hierynomus/spnego/d;->a:I

    new-instance v2, Lcom/hierynomus/asn1/a1;

    invoke-direct {v2, p2}, Lcom/hierynomus/asn1/a1;-><init>(Lcom/hierynomus/asn1/f;)V

    const/4 p2, 0x1

    invoke-direct {v0, p2, v1, v2}, Lcom/hierynomus/asn1/f1;-><init>(ZILcom/hierynomus/asn1/e;)V

    .line 2
    new-instance p2, Lcom/hierynomus/asn1/f;

    invoke-direct {p2}, Lcom/hierynomus/asn1/f;-><init>()V

    .line 3
    sget-object v1, Lcom/hierynomus/spnego/c;->a:Lcom/hierynomus/asn1/m;

    invoke-virtual {p2, v1}, Lcom/hierynomus/asn1/f;->a(Lcom/hierynomus/asn1/e;)V

    .line 4
    invoke-virtual {p2, v0}, Lcom/hierynomus/asn1/f;->a(Lcom/hierynomus/asn1/e;)V

    .line 5
    new-instance v0, Lcom/hierynomus/asn1/l0;

    const/4 v1, 0x0

    invoke-direct {v0, v1, p2}, Lcom/hierynomus/asn1/l0;-><init>(ILcom/hierynomus/asn1/f;)V

    .line 6
    invoke-virtual {v0}, Lcom/hierynomus/asn1/l;->e()[B

    move-result-object p2

    invoke-virtual {p1, p2}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a([B)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-void
.end method
